package main

import (
	"SortSet/cmdServer"
	"SortSet/server"
	"flag"
	"fmt"
	"os"
)

const (
	RUNTYPE_CMD    = 1
	RUNTYPE_SERVER = 2
)

func main() {
	flag.Usage = func() {
		fmt.Printf("Usage of %s:\n", os.Args[0])
		fmt.Printf("-r 可选值1,2 1:CMD模式,2:Server模式\n")
		flag.PrintDefaults()
	}
	var runType int
	flag.IntVar(&runType, "r", RUNTYPE_SERVER, "specify runType, default is 1(CMD);2 is server")
	flag.Parse()
	if runType == RUNTYPE_CMD {
		cmdServer.Run()
	}
	if runType == RUNTYPE_SERVER {
		server.Run()
	}
}
